<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta content="width=device-width, initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0, user-scalable=no" name="viewport">
<meta content="yes" name="apple-mobile-web-app-capable" />
<meta content="black" name="apple-mobile-web-app-status-bar-style" />
<meta content="telephone=no" name="format-detection" />
<title>搜索页面</title>
<script src="js/jquery.min.js" ></script>
<script src="js/common.js" ></script>
<!--消息 脚本-->
<link rel="stylesheet" href="css/amazeui.min.css">
<script src="js/amazeui.min.js"></script>
<!--消息 脚本-->
<!--标准mui.css-->
<link rel="stylesheet" href="css/mui.min.css">
<!--App自定义的css-->
<link rel="stylesheet" type="text/css" href="css/base.css">
<link rel="stylesheet" type="text/css" href="css/common.css">
<style>
.search-page{ position:absolute; bottom:0; top:0; left:0; right:0; background-color:#fff; z-index:9999; }
.search-over-header {
	position:relative;
	background-color: #f8f8f8;
	border-bottom: 1px solid #dcdcdc;
	width:100%;
	height: 44px;
	padding-right: 10px;
	padding-left: 10px;
	backface-visibility: hidden;
	-webkit-box-shadow: 0 0 0 #fff;
	box-shadow: 0 0 0 #fff;
}
.back-index{
    position: absolute;
    left:10px;
	top:10px;
    width: 12px;
    height: 24px;
	display:block;
    background-image: url(images/h-back.png);
    background-position: center center;
    background-repeat: no-repeat;
    background-size: 12px 24px;
}
.search-over-page div {
	position:absolute;
	left:30px;
	right:0;
	display:-moz-box;
	display:-webkit-box;
	display:box;
	-webkit-box-align: center;
	box-align: center;
	-webkit-align-items: center;
	align-items: center;
}
.search-over-page input {
	color:#000000;
	overflow: hidden;
	background-color: #fff;
	-moz-border-radius: 500px;
	-webkit-border-radius: 500px;
	border-radius: 500px;
	margin:5px 0;
	padding:7px 15px;
	height:34px;
	line-height:20px;
	font-size:15px;
	-webkit-box-flex: 1;
	-moz-box-flex: 1;
	-ms-box-flex: 1;
	box-flex: 1;
	display:block;
}
.search-over-page input::-webkit-input-placeholder {
color:#999999;
font-size:15px;
padding:0;
}
.search-over-page input:-moz-placeholder {
color:#999999;
font-size:15px;
padding:0;
}
.search-over-page input::-moz-placeholder {
color:#999999;
font-size:15px;
padding:0;
}
.search-over-page input:-ms-input-placeholder {
color:#999999;
font-size:15px;
padding:0;
}
.search-over-page button {
	width:60px;
	background-color: #dd2727;
	height:34px;
	line-height:34px;
	font-size:15px;
	color:#fff;
	-moz-border-radius: 500px;
	-webkit-border-radius: 500px;
	border-radius: 500px;
	margin:5px;
	display:block;
}
.search-tit{ font-size:14px; padding:10px 10px 0 10px; }
.search-list ul{ padding:10px; }
.search-list ul li{ float:left;	-moz-border-radius: 500px;
-webkit-border-radius: 500px;
border-radius: 500px; background-color:#CCC;  margin-right:10px; margin-bottom:10px; }
.search-list ul li a{ color:#fff; font-size:12px; padding:1px 10px;}
</style>
</head>
<body>
<div id="indexVm" v-cloak>
  <!--搜索页面-->
  <div class="search-page">
    <!--搜索框-->  
    <header class="search-over-header"> 
      <a href="javascript:history.go(-1)" target=_self class="back-index"></a>
      <div class="search-over-page">
        <div>
          <input id="search" type="text" name="search" placeholder="搜索想要的宝贝" autofocus="autofocus" >
          <button onclick="searchProduct()">搜索</button>
        </div>
      </div>
    </header>
    <!--搜索框-->    
    <div class="search-list">
      <div class="search-tit">历史搜索</div>
      <ul class="clearfix">
        <li v-for="wsMemberSearchLog in wsMemberSearchLogList">
        	<a v-bind:href="'productSearchList.html?lable='+wsMemberSearchLog.searchLable">{{wsMemberSearchLog.searchLable}}</a>
        </li>
      </ul>
    </div>
    <!--热门搜索--历史搜索-->  
  </div>
  <!--搜索页面-->
</div>
<!--container-end-->
<script src="js/mui.min.js"></script>
<script src="js/wxshop.js"></script>
<script src="js/vue.js"></script>
<script>
var vm = new Vue({
	el: '#indexVm',
	data: {
		wsMemberSearchLogList: [],
	},
	created: function () {
		mui.ajax(wxshop.serverUrl+"/search", {
			type: "post",
			data:{
				code:wxshop.getUrlParam("code")
			},
			dataType: "json",
			success: function(data) {
				if(data.ret==0){
					mui.alert(data.msg);
				}
				if(data.ret==2){
					wxshop.getOpenId(data.appid);
				}	
				vm.wsMemberSearchLogList=data.wsMemberSearchLogList;
			},
			error: function() {
				mui.alert("后台接口请求失败，请联系管理员！错误"+errorThrown);
			}
		});
	},
});	
function searchProduct(){
	var lable=$("#search").val();
	mui.openWindow({url:encodeURI("productSearchList.html?lable="+lable)});
}
</script>
</body>
</html>
